package org.hyjiacan.deadqq.common.entity;

import java.io.Serializable;
import java.sql.Date;

public class Message implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7422564756412675334L;
	private int senderNumber;
	private int receiverNumber;
	private Date date;
	private String content;
	private boolean isRead;

	public int getSenderNumber() {
		return senderNumber;
	}

	public void setSenderNumber(int senderNumber) {
		this.senderNumber = senderNumber;
	}

	public int getReceiverNumber() {
		return receiverNumber;
	}

	public void setReceiverNumber(int receiverNumber) {
		this.receiverNumber = receiverNumber;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public boolean isRead() {
		return isRead;
	}

	public void setRead(boolean isRead) {
		this.isRead = isRead;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((content == null) ? 0 : content.hashCode());
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + receiverNumber;
		result = prime * result + senderNumber;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Message other = (Message) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (receiverNumber != other.receiverNumber)
			return false;
		if (senderNumber != other.senderNumber)
			return false;
		return true;
	}
}
